<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://schemas.ScrumForTeamSystem.com/TransitionService/RulesCollection" elementFormDefault="qualified" targetNamespace="http://schemas.ScrumForTeamSystem.com/TransitionService/RulesCollection" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="ArrayOfTransitionRule" nillable="true" type="tns:ArrayOfTransitionRule" />
  <xs:complexType name="ArrayOfTransitionRule">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="TransitionRule" nillable="true" type="tns:TransitionRule" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="TransitionRule">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="WorkItemTypeName" type="tns:SourceTargetPair" />
      <xs:element minOccurs="1" maxOccurs="1" name="Transition" type="tns:Transition" />
      <xs:element minOccurs="1" maxOccurs="1" name="LinkType" type="tns:LinkType" />
      <xs:element minOccurs="1" maxOccurs="1" name="ChangeNote" type="xs:string" />
      <xs:element minOccurs="1" maxOccurs="1" name="EligibleTargetStates" type="tns:ArrayOfString" />
      <xs:element minOccurs="1" maxOccurs="1" name="Replacements" type="tns:ArrayOfReplacement" />
      <xs:element minOccurs="0" maxOccurs="1" name="SiblingConditions" type="tns:ArrayOfSiblingCondition" />
    </xs:sequence>
    <xs:attribute name="syncexcluded" type="xs:boolean" use="optional" default="false" />
  </xs:complexType>
  <xs:complexType name="ArrayOfString">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="State" nillable="true" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ArrayOfReplacement">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="Replacement" nillable="true" type="tns:Replacement" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Replacement">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="targetfield" type="xs:string" use="required" />
        <xs:attribute name="type" type="tns:ReplacementValueOption" use="required" />
        <xs:attribute name="decimalplaces">
          <xs:simpleType>
            <xs:restriction base="xs:token">
              <xs:maxLength value="3" />
              <xs:pattern value="[0-9]*" />
            </xs:restriction>
          </xs:simpleType>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:simpleType name="ReplacementValueOption">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Specified" />
      <xs:enumeration value="Expression" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="Transition">
    <xs:attribute name="field" type="xs:string" use="required" />
    <xs:attribute name="from" type="xs:string" use="required" />
    <xs:attribute name="to" type="xs:string" use="required" />
  </xs:complexType>
  <xs:complexType name="LinkType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="target" type="tns:LinkOption" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:simpleType name="LinkOption">
    <xs:restriction base="xs:string">
      <xs:enumeration value="LinkedItem" />
      <xs:enumeration value="Self" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SourceTargetPair">
    <xs:attribute name="source" type="xs:string" use="required" />
    <xs:attribute name="target" type="xs:string" use="required" />
  </xs:complexType>
  <xs:complexType name="ArrayOfSiblingCondition">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="SiblingCondition" nillable="true" type="tns:SiblingCondition" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="SiblingCondition">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="ExcludedStates" type="tns:ArrayOfString" />
    </xs:sequence>
    <xs:attribute name="comparison" type="tns:SiblingComparisonType" use="required" />
    <xs:attribute name="link" type="xs:string" use="required" />
    <xs:attribute name="field" type="xs:string" use="required" />
    <xs:attribute name="value" type="xs:string" use="required" />
    <xs:attribute name="siblingtype" type="xs:string" use="required" />
  </xs:complexType>
  <xs:simpleType name="SiblingComparisonType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="All" />
      <xs:enumeration value="Any" />
    </xs:restriction>
  </xs:simpleType>
</xs:schema>